import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import layout from '@/layout/index.vue'
const firstPage = '/home'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/home',
        name: '首页',
        component: () => import('@/views/home/index.vue')
    },
    {
        path: '/pageSetting',
        name: '设置',
        component: () => import('@/views/pageSetting/index.vue')
    },
]

const router = createRouter({
    history: createWebHistory(), // 路由模式：history模式
    routes:[
        {
            path: '/',
            redirect:firstPage,
            name: 'layout',
            component: layout,
            children:routes
        },
    ]
})

export default router
